package com.demo.demo.rabbitmq.direct;

import com.demo.demo.utils.RabbitMQUtils;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class Provider {
    public static void main(String[] args) throws IOException, TimeoutException {
        Connection connection = RabbitMQUtils.getConnection();
        Channel channel = connection.createChannel();

        //声明交换机 参数一：交换机名称   参数二：交换机类型 direct 路由
        channel.exchangeDeclare("log_direct","direct");

        String rotekey = "info";

        channel.basicPublish("log_direct",rotekey,null,"路由".getBytes());

    }
}
